{extends 'form.html'}
{block name="nav_package"}			
	<ul class="current">
		<li><a href="ctlr_package-act_all"><b>Packages</b><!--[if IE 7]><!--></a><!--<![endif]-->
			<!--[if lte IE 6]><table><tr><td><![endif]-->
			<div class="select_sub show">
				<ul class="sub">
					<li><a href="ctlr_package-act_all">View all packages</a></li>
					
					<li {if !isset($package->id) || $package->id eq ""}class="sub_show"{/if}>
						<a href="ctlr_package-act_create">Add package</a>
					</li>
					<li {if isset($package->id) && $package->id ne ""}class="sub_show"{/if}>
						<a href="#nogo">edit package</a>
					</li>
				</ul>
			</div>
			<!--[if lte IE 6]></td></tr></table></a><![endif]-->
		</li>
	</ul>
	<div class="nav-divider">&nbsp;</div>
{/block}
{block name="op-title"}
	{if isset($package->id) && $package->id ne ""}
		<h1>Edit package - : {$package->name}</h1>
	{else}
		<h1>Add package</h1>
	{/if}
{/block}
{block name="msgs"}
		<div id="message-blue">
			<table border="0" width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td class="blue-left">Welcome back. <a href="ctlr_package-act_all">View packages.</a> </td>
					<td class="blue-right"><a class="close-blue"><img src="{$assets}images/table/icon_close_blue.gif"   alt="" /></a></td>
				</tr>
			</table>
		</div>
		{if isset($validate_errors)}
		<div id="message-red">
			<table border="0" width="100%" cellpadding="0" cellspacing="0">
			<tr>
				<td class="red-left">Error. <a href="">Please try again.</a></td>
				<td class="red-right"><a class="close-red"><img src="{$assets}images/table/icon_close_red.gif"   alt="" /></a></td>
			</tr>
			</table>
		</div>
		{/if}
		{if isset($info)}
		<div id="message-green">
			<table border="0" width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td class="green-left">{$info}. <a href="ctlr_package-act_create">Add new one.</a></td>
					<td class="green-right"><a class="close-green"><img src="{$assets}images/table/icon_close_green.gif"   alt="" /></a></td>
				</tr>
			</table>
		</div> 
		{/if}		
{/block}
{block name="tabs"}
		{if isset($package->id) && $package->id ne ""}
			<div id="tab-holder">
			{if isset($menu) && $menu eq "general"}
				<div class="step-dark"><a href="ctlr_package-act_edit?id={$package->id}">General</a></div>
			{else}
				<div class="step-light"><a href="ctlr_package-act_edit?id={$package->id}">General</a></div>
			{/if}
			{if isset($menu) && $menu eq "inclusion"}
				<div class="step-dark"><a href="ctlr_packageinclusion-act_inclusions?id={$package->id}">Inclusions</a></div>
			{else}
				<div class="step-light"><a href="ctlr_packageinclusion-act_inclusions?id={$package->id}">Inclusions</a></div>
			{/if}
			{if isset($menu) && $menu eq "exclusion"}
				<div class="step-dark"><a href="ctlr_packageexclusion-act_exclusions?id={$package->id}">Exclusions</a></div>
			{else}
				<div class="step-light"><a href="ctlr_packageexclusion-act_exclusions?id={$package->id}">Exclusions</a></div>
			{/if}			
			{if isset($menu) && $menu eq "imagex"}	
				<div class="step-dark"><a href="ctlr_packageimagex-act_imagexs?id={$package->id}">Images</a></div>
			{else}
				<div class="step-light"><a href="ctlr_packageimagex-act_imagexs?id={$package->id}">Images</a></div>
			{/if}
			{if isset($menu) && $menu eq "facility"}	
				<div class="step-dark"><a href="ctlr_packagefacility-act_facilitys?id={$package->id}">Facilities</a></div>
			{else}
				<div class="step-light"><a href="ctlr_packagefacility-act_facilitys?id={$package->id}">Facilities</a></div>
			{/if}
			{if isset($menu) && $menu eq "pckgOption"}	
				<div class="step-dark"><a href="ctlr_packagepckgOption-act_pckgOptions?id={$package->id}">Package Options</a></div>
			{else}
				<div class="step-light"><a href="ctlr_packagepckgOption-act_pckgOptions?id={$package->id}">Package Options</a></div>
			{/if}
			{if isset($menu) && $menu eq "hotel"}	
				<div class="step-dark"><a href="ctlr_packagehotel-act_hotels?id={$package->id}">Hotels</a></div>
			{else}
				<div class="step-light"><a href="ctlr_packagehotel-act_hotels?id={$package->id}">Hotels</a></div>
			{/if}			
			{if isset($menu) && $menu eq "price"}	
				<div class="step-dark"><a href="ctlr_packageprice-act_prices?id={$package->id}">Price</a></div>
			{else}
				<div class="step-light"><a href="ctlr_packageprice-act_prices?id={$package->id}">Price</a></div>
			{/if}
			{if isset($menu) && $menu eq "content"}	
				<div class="step-dark"><a href="ctlr_packagecontent-act_contents?id={$package->id}">Content</a></div>
			{else}
				<div class="step-light"><a href="ctlr_packagecontent-act_contents?id={$package->id}">Content</a></div>
			{/if}
				<div class="clear"></div>
			</div>
		{else}
			<div id="tab-holder">
				<div class="step-dark">General</div>
				<div class="step-light">Inclusions</div>
				<div class="step-light">Exclusions</div>
				<div class="step-light">Images</div>
				<div class="step-light">Faclities</div>
				<div class="step-light">Package Options</div>
				<div class="step-light">Hotels</div>
				<div class="step-light">Price</div>
				<div class="step-light">Contents</div>
				<div class="clear"></div>
			</div>
		{/if}
{/block}
{block name="main"}
	{if isset($package->id) && $package->id ne ""}
	<form name="package_edit" method='POST' action="ctlr_package-act_update" accept-charset='UTF-8'>
		<input type="hidden" name="id" value="{$package->id}">
	{else}
	<form name="package_new" method='POST' action="ctlr_package-act_save" accept-charset='UTF-8'>
	{/if}
		<table border="0" cellpadding="0" cellspacing="0"  id="id-form">
			<tr>
				<th valign="top">Package Type:</th>
				<td>
					<select  name="type" class="styledselect_form_1">
						<option value="domestic" {if $package->type eq 'domestic'}selected {/if}>Domestic</option>
						<option value="international" {if $package->type eq 'international'}selected {/if} >International</option>
					</select>
				</td>	
				<td>
					<div class="bubble-left"></div>
					<div class="bubble-inner">Please select package type.</div>
					<div class="bubble-right"></div>
				</td>
			</tr>
			<tr>
				<th valign="top">Name:</th>
				<td>
					<input type="text" name="name" 
					{if isset($validate_errors['name'])}
						class="inp-form-error" 
					{else} 
						class="inp-form" 
					{/if} 
					value="{$package->name}"/>
				</td>	
				<td>
					{if isset($validate_errors['name'])}
						<div class="error-left"></div>
						<div class="error-inner">This field is required.</div>
					{else}
						<div class="bubble-left"></div>
						<div class="bubble-inner">This field is required.</div>
						<div class="bubble-right"></div>
					{/if}
				</td>
			</tr>
			<tr>
				<th valign="top">SEO Name:</th>
				<td>
					<input type="text" name="seoname" 
					{if isset($validate_errors['seoname'])}
						class="inp-form-error" 
					{else} 
						class="inp-form" 
					{/if} 
					value="{$package->seoname}"/>
				</td>	
				<td>
					{if isset($validate_errors['seoname'])}
						<div class="error-left"></div>
						<div class="error-inner">This field is required.</div>
					{else}
						<div class="bubble-left"></div>
						<div class="bubble-inner">This field is required.</div>
						<div class="bubble-right"></div>
					{/if}
				</td>
			</tr>
			<tr>
				<th valign="top">Package Code:</th>
				<td>
					<input type="text" name="packagecode" 
					{if isset($validate_errors['packagecode'])}
						class="inp-form-error" 
					{else} 
						class="inp-form" 
					{/if} 
					value="{$package->packagecode}"/>
				</td>	
				<td>
					{if isset($validate_errors['packagecode'])}
						<div class="error-left"></div>
						<div class="error-inner">This field is required.</div>
					{else}
						<div class="bubble-left"></div>
						<div class="bubble-inner">Please provide package code.</div>
						<div class="bubble-right"></div>
					{/if}
				</td>
			</tr>
			<tr>
				<th valign="top">Package Highlight:</th>
				<td>
					<textarea id="elm1" rows="" cols="" name="highlight" class="form-textarea">{$package->highlight}</textarea>
				</td>	
				<td>
					<div class="bubble-left"></div>
					<div class="bubble-inner">You can use editor for highlight.</div>
					<div class="bubble-right"></div>
				</td>
			</tr>			
			<tr>
				<th valign="top">Short Description:</th>
				<td>
					<textarea id="elm1" rows="" cols="" name="shortdesc" class="form-textarea">{$package->shortdesc}</textarea>
				</td>	
				<td>
					<div class="bubble-left"></div>
					<div class="bubble-inner">You can use editor for short description.</div>
					<div class="bubble-right"></div>
				</td>
			</tr>
			<tr>
				<th valign="top">Long Description:</th>
				<td>
					<textarea id="elm1" rows="" cols="" name="longdesc" class="form-textarea">{$package->longdesc}</textarea>
				</td>	
				<td>
					<div class="bubble-left"></div>
					<div class="bubble-inner">You can use editor for long description.</div>
					<div class="bubble-right"></div>
				</td>
			</tr>
			<tr>
				<th valign="top">Starting City:</th>
				<td>
					<input type="text" name="startingcity" 
					{if isset($validate_errors['startingcity'])}
						class="inp-form-error" 
					{else} 
						class="inp-form" 
					{/if} 
					value="{$package->startingcity}"/>
				</td>	
				<td>
					<div class="bubble-left"></div>
					<div class="bubble-inner">You can use editor for starting city.</div>
					<div class="bubble-right"></div>
				</td>
			</tr>
			<tr>
				<th valign="top">Original Price (INR):</th>
				<td>
					<input type="text" name="price" 
					{if isset($validate_errors['price'])}
						class="inp-form-error" 
					{else} 
						class="inp-form" 
					{/if} 
					value="{$package->price}"/>
				</td>	
				<td>
					{if isset($validate_errors['price'])}
						<div class="error-left"></div>
						<div class="error-inner">This field is required.</div>
					{else}
						<div class="bubble-left"></div>
						<div class="bubble-inner">Please provide price.</div>
						<div class="bubble-right"></div>
					{/if}
				</td>
			</tr>
			<tr>
				<th valign="top">Final Price (INR):</th>
				<td>
					<input type="text" name="finalprice" 
					{if isset($validate_errors['finalprice'])}
						class="inp-form-error" 
					{else} 
						class="inp-form" 
					{/if} 
					value="{$package->finalprice}"/>
				</td>	
				<td>
					{if isset($validate_errors['finalprice'])}
						<div class="error-left"></div>
						<div class="error-inner">This field is required.</div>
					{else}
						<div class="bubble-left"></div>
						<div class="bubble-inner">Please provide price.</div>
						<div class="bubble-right"></div>
					{/if}
				</td>
			</tr>
			<tr>
				<th valign="top">Price Quote:</th>
				<td>
					<input type="text" name="pricequote" 
					{if isset($validate_errors['pricequote'])}
						class="inp-form-error" 
					{else} 
						class="inp-form" 
					{/if} 
					value="{$package->pricequote}"/>
				</td>	
				<td>
					{if isset($validate_errors['pricequote'])}
						<div class="error-left"></div>
						<div class="error-inner">This field is required.</div>
					{else}
						<div class="bubble-left"></div>
						<div class="bubble-inner">Please provide price quote.</div>
						<div class="bubble-right"></div>
					{/if}
				</td>
			</tr>
			<tr>
				<th valign="top">Valid from date:</th>
				<td class="noheight">
					<table border="0" cellpadding="0" cellspacing="0">
						<tr  valign="top">
							<td>
								<input type="text" name="fromdate" 
								{if isset($validate_errors['fromdate'])}
									class="inp-form-error" 
								{else} 
									class="inp-form" 
								{/if} 
								value="{$package->fromdate}"/>
							</td>
							<td><a href="#"  class="date-pick"><img src="{$assets}images/forms/icon_calendar.jpg"   alt="" /></a></td>
						</tr>
					</table>
				</td>
				<td>
					<div class="bubble-left"></div>
					<div class="bubble-inner">Please provide Valid from in format yyyy-mm-dd.</div>
					<div class="bubble-right"></div>
				</td>
			</tr>
			<tr>
				<th valign="top">Valid to date:</th>
				<td class="noheight">
					<table border="0" cellpadding="0" cellspacing="0">
					<tr  valign="top">
						<td>
							<input type="text" name="todate" 
							{if isset($validate_errors['todate'])}
								class="inp-form-error" 
							{else} 
								class="inp-form" 
							{/if} 
							value="{$package->todate}"/>
						</td>
						<td><a href="#"  class="date-pick"><img src="{$assets}images/forms/icon_calendar.jpg"   alt="" /></a></td>
					</tr>
					</table>
				</td>
				<td>
					<div class="bubble-left"></div>
					<div class="bubble-inner">Please provide Valid to in format yyyy-mm-dd.</div>
					<div class="bubble-right"></div>
				</td>
			</tr>
			<tr>
				<th valign="top">Valid Quote if any:</th>
				<td>
					<textarea id="elm1" rows="" cols="" name="validquote" class="form-textarea">{$package->validquote}</textarea>
				</td>	
				<td>
					<div class="bubble-left"></div>
					<div class="bubble-inner">Please enter Valid Quote.</div>
					<div class="bubble-right"></div>
				</td>
			</tr>
			<tr>
				<th valign="top">Tour Plan:</th>
				<td>
					<textarea id="elm1" rows="" cols="" name="tourplan" class="form-textarea">{$package->tourplan}</textarea>
				</td>	
				<td>
					<div class="bubble-left"></div>
					<div class="bubble-inner">Please enter brief tour plan.</div>
					<div class="bubble-right"></div>
				</td>
			</tr>			
			<tr>
				<td>
					Nights<input type="text" name="nights" size="4" value="{$package->nights}"/> /
				</td>
				<td>
					Days <input type="text" name="days" size="4" value="{$package->days}"/>
				</td>	
				<td>
					<div class="bubble-left"></div>
					<div class="bubble-inner">Please enter nights and days.</div>
					<div class="bubble-right"></div>
				</td>
			</tr>			
		{if isset($package->id) && $package->id ne ""}
			{foreach from=$package->ownItinerary key=k item=v}
			<tr>
				<th valign="top">Day{$v->day} Title:</th>
				<td>
					<input type="text" name="daystitle[{$v->id}]" class="inp-form"	value="{$v->title}"/>
				</td>	
				<td>
					<div class="bubble-left"></div>
					<div class="bubble-inner">Please enter day{$v->day} title.</div>
					<div class="bubble-right"></div>
				</td>
			</tr>
			<tr>
				<th valign="top">Day{$v->day} Description:</th>
				<td>
					<textarea id="elm1" rows="" cols="" name="dayslongdesc[{$v->id}]" class="form-textarea">{$v->longdesc}</textarea>
				</td>	
				<td>
					<div class="bubble-left"></div>
					<div class="bubble-inner">Please enter day{$v->day} description</div>
					<div class="bubble-right"></div>
				</td>
			</tr>			
			{/foreach}
		{/if}
			<tr>	
				<th>&nbsp;</th>
				<td valign="top">
					<input type="submit" name="Submit" value="Submit" class="form-submit" />
					<input type="reset" value="" class="form-reset"  />
				</td>
				<td></td>
			</tr>
		</table>
	</form>
{/block}
{block name="act"}
		<div id="related-activities">
			<div id="related-act-top">
				<img src="{$assets}images/forms/header_related_act.gif" width="271" height="43" alt="" />
			</div>
			<div id="related-act-bottom">
				<div id="related-act-inner">			
					<div class="left"><a href="ctlr_package-act_create"><img src="{$assets}images/forms/icon_plus.gif" width="21" height="21" alt="" /></a></div>
						<div class="right">
							<h5>Add another package</h5>
							<ul class="greyarrow">
								<li><a href="ctlr_package-act_create">Click here</a></li> 
							</ul>
						</div>
						
						<div class="clear"></div>
					{if isset($package->id) && $package->id ne ""}
						<div class="lines-dotted-short"></div>
						
						<div class="left"><a href="ctlr_package-act_delete?id={$package->id}"><img src="{$assets}images/forms/icon_minus.gif" width="21" height="21" alt="" /></a></div>
						<div class="right">
							<h5>Delete current package</h5>
							<ul class="greyarrow">
								<li><a href="ctlr_package-act_delete?id={$package->id}">Click here </a></li>
							</ul>
						</div>
						
						<div class="clear"></div>
					{/if}
				</div>
				<div class="clear"></div>
			</div>
		</div>	
{/block}